﻿using GrayParrot.Configuration;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GrayParrot.Communications.Configuration
{
    /// <summary>
    /// 
    /// </summary>
    /// <seealso cref="GrayParrot.Configuration.ConfigurationSectionBase{GrayParrot.Communications.Configuration.CommunicationsSettings}" />
    public class CommunicationsSettings : ConfigurationSectionBase<CommunicationsSettings>
    {
        /// <summary>
        /// Gets or sets the endpoint.
        /// </summary>
        /// <value>
        /// The endpoint.
        /// </value>
        [ConfigurationProperty("endpoint", IsRequired = true, IsKey = false)]
        public string Endpoint
        {
            get { return (string)base["endpoint"]; }
            set { base["endpoint"] = value; }
        }

        /// <summary>
        /// Gets or sets the subscription.
        /// </summary>
        /// <value>
        /// The subscription.
        /// </value>
        [ConfigurationProperty("subscription", IsRequired = true, IsKey = false)]
        public string Subscription
        {
            get { return (string)base["subscription"]; }
            set { base["subscription"] = value; }
        }

        /// <summary>
        /// Gets the email settings.
        /// </summary>
        /// <value>
        /// The email settings.
        /// </value>
        /// <remarks>
        /// From: the From propoerty of the email...
        /// To: a collection of email address to send to the email...
        /// Cc: a collection of email address to send to the email in cc...
        /// EmailDeliverySettings: sets the disposition notifications...
        /// </remarks>
        [ConfigurationProperty("emailSettings", IsRequired = false, IsKey = false)]
        public EmailSettings EmailSettings
        {
            get { return (EmailSettings)base["emailSettings"]; }
            set { base["emailSettings"] = value; }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CommunicationsSettings"/> class.
        /// </summary>
        public CommunicationsSettings()
        {
        }
    }
}
